import 'dart:convert';

import 'package:dio/dio.dart';
class DioConfig{
  final Dio dio=Dio();
  DioConfig(String baseUrl){
    dio.options.baseUrl=baseUrl;
    dio.options.headers={
      'Content-Type': 'application/json',
    };
  }

  Future get(String apiUrl,Map<String,dynamic> params,String json,Map<String,String> headers) async{
    return await dio.get(apiUrl,data: json,queryParameters: params,options: Options(headers: headers));
  }

  Future post(String apiUrl,Map<String,dynamic> params,String json,Map<String,String> headers) async{
    return await dio.post(apiUrl,data: json,queryParameters: params,options: Options(headers: headers));
  }

  Future delete(String apiUrl,Map<String,dynamic> params,String json,Map<String,String> headers) async{
    return await dio.delete(apiUrl,data:json,queryParameters: params,options: Options(headers: headers));
  }

  Future put(String apiUrl,Map<String,dynamic> params,String json,Map<String,String> headers) async{
    return await dio.put(apiUrl,data:json,queryParameters: params,options: Options(headers: headers));
  }



}